package java111;

import java.util.*;
public class Main1 {
    public static void main1(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] arr = new int[6];
        while(n-- > 0){
            for(int i = 0; i < 6; i++){
                arr[i] = in.nextInt();
            }
            Arrays.sort(arr);
            if(solutin(arr)){
                System.out.println("Yes");
            } else {
                System.out.println("No");
            }
        }
    }
    public static boolean solutin(int[] arr){
        for(int i = 0; i < 4; i++){
            for(int j = i+1; j < 5; j++){
                for(int z = j+1; z < 6; z++){
                    if((arr[i] + arr[j] > arr[z]))
                        if(elem(arr, i, j, z)){
                        return true;
                    }
                }
            }
        }
        return false;
    }
    public static boolean elem(int[] arr, int x, int y, int z){
        int[] nums = new int[3];
        int count = 0;
        for(int i = 0; i < arr.length; i++){
            if(i != x && i != y && i != z){
                nums[count++] = i;
            }
        }
        if(arr[nums[0]] + arr[nums[1]] > arr[nums[2]]){
            return true;
        } else {
            return false;
        }
    }

    public static void main(String[] args) {
        String s = null;
        StringBuilder sb = new StringBuilder();
        sb.append(s);
        System.out.println(sb + " " + sb.length());
    }
}